import React, { Component } from 'react'

export default class Lists extends Component {
    constructor(props) {
        super(props)
        this.state = {
            list: [1, 2, 3, 4, 5]
        }
    }

    render() {
        return (
            <div>
                列表遍历
                <hr />
                <ul>
                    {
                        this.state.list.map((number, index) =>
                            <li key={number + index}>{number}</li>
                        )
                    }
                </ul>
            </div>
        )
    }
}